CentOS7 : oracle 11g install brief

xrdp 설치 후 원격데스탑으로 서버에 접속하여 oracle을 설치할 수 있다.  

오라클설치 패키지가 한글이 올바로 지원하지 않을 경우가 있으므로 X윈도우를 영문으로 세팅하여 설치하는 것이 권장할만하다.

 

X윈도우 언어설정

X윈도우의 언어 설정을 다듬과 같은 명령으로 설정할 수 있다.  


# localectl status

# localectl list-keymaps | grep kr

# localectl set-keymap kr

# localectl set-x11-keymap kr

# localectl --no-convert set-x11-keymap kr

# locale

# locale -a | grep en_US

# locale-gen en_US.UTF-8 vi /etc/locale.conf

 

오라클을 위한 공유메모리 추가설정

수동

# mount -t tmpfs -o size=20g tmpfs /dev/shm

자동

# vi /etc/fstab
tmpfs /dev/shm tmpfs size=20g 0 0

호스트설정

# vi /etc/hosts

127.0.0.1  localhost localhost.localdomain

192.168.0.49 centos7  

or  

127.0.0.1 centos7 localhost localhost.localdomain

 

오라클 계정 및 그룹등록

# groupadd oinstall

# groupadd dba

# groupadd oper    

# useradd -g oinstall -G dba,oper oracle

# passwd oracle   oracle 계정에 그룹을 추가할 때

# usermod -G dba,oper oracle

 

오라클용 시스템환경 추가

# vi /etc/sysctl.conf

kernel.shmmni = 4096

kernel.shmmax = 4398046511104

kernel.shmall = 1073741824

kernel.sem = 250 32000 100 128

fs.aio-max-nr = 1048576

fs.file-max = 6815744

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048586  

# sysctl -p  

만일 이 과정을 누락하면 설치과정에 경고한다.

자동으로 이 설정을 추가하는 스크립트를 제공한다.

 

오라클설치시 안내하는 자동스크립트 실행결과 사례

kernel.sem =   100

fs.file-max = 6815744

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default = 262144

net.core.wmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_max = 1048576

 

오라클용 shell limits 설정

# vi /etc/security/limits.conf

oracle soft nproc 131072

oracle hard nproc 131072

oracle soft nofile 131072

oracle hard nofile 131072

oracle soft core unlimited

oracle hard core unlimited

oracle soft memlock 50000000

oracle hard memlock 50000000

 

오라클용 profile 추가

# vi /etc/profile

or

# vi /home/oracle/.bash_profile

#oracle

TMP=/tmp; export TMP

TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=owl; export ORACLE_HOSTNAME

ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME

ORACLE_BASE=/home/oracle/app/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME

ORACLE_SID=orcl; export ORACLE_SID

ORACLE_TERM=xterm; export ORACLE_TERM

ORACLE_OWNER=oracle; export ORACLE_OWNER

#HOME = /home/derp/faxagent; export HOME

FAX_HOME=/home/derp/faxagent; export FAX_HOME

PATH=/usr/sbin:$PATH; export PATH

PATH=$ORACLE_HOME/bin:$FAX_HOME/bin:$PATH; export PATH

#export NLS_LANG=KOREAN_KOREA.KO16KSC5601

export NLS_LANG=AMERICAN_AMERICA.KO16KSC5601

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

if [ $USER = "oracle" ]; then

  if [ $SHELL = "/bin/ksh" ]; then

    ulimit -p 16384

    ulimit -n 65536

  else

    ulimit -u 16384 -n 65536

  fi

fi

if [ $USER = "root" ]; then

        ulimit -u unlimited -n 90000

fi

오라클용 패키지 설치여부 확인

# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n' binutils \
elfutils-libelf \
elfutils-libelf-devel \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
ksh \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
sysstat \
unixODBC \
unixODBC-devel

오라클 관련 패키지 설치

#yum install binutils \
elfutils-libelf \
elfutils-libelf-devel \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
ksh \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
sysstat \
unixODBC \
unixODBC-devel

오라클설치폴더 생성

# mkdir -p /home/oracle/app/oracle

# chown -R oracle.oinstall /home/oracle/app/oracle

# chmod -R 775 /home/oracle/app

# mkdir /home/oracle/app/oraInventory

# chown -R oracle.oinstall /home/oracle/app/oraInventory/

X윈도우실행 또는 원격데스크탑 접속후,

터미널을 열고, 오라클설치본 폴더이동

# su -l oracle

$ cd "오라클설치폴더"

GUI용 오라클 설치 시작

$ ./runInstall

설치중 자동환경설정 스크립트 실행

# /tmp/CVU_11.2.0.1.0_oracle/runfixup.sh

To fix this error edit $ORACLE_HOME/sysman/lib/ins_emagent.mk

# vi /home/oracle/app/oracle/product/11.2.0/dbhome_1/ctx/lib/ins_ctx.mk

ctxhx: $(CTXHXOBJ)

        -static $(LINK_CTXHX) $(CTXHXOBJ) $(INSO_LINK)

#vi /home/oracle/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk

$(MK_EMAGENT_NMECTL) -lnnz11




# yum install libstdc++-static libstdc++-static.i686

# yum install compat-libstdc++-33

# yum install glibc-static

# yum install glibc-static.i686

 

설치완료후. root 권한으로 명령실행

# /home/oracle/app/oraInventory/orainstRoot.sh

# /home/oracle/app/oracle/product/11.2.0/dbhome_1/root.sh

오라클 자동실행

# vi /etc/oratab

orcl:/home/oracle/app/oracle/product/11.2.0/dbhome_1:Y

emctl status dbconsole
emctl start dbconsole
emctl stop dbconsole


lsnrctl status LISTENER
lsnrctl start LISTENER
lsnrctl stop LISTENER



extra Hint

vi /etc/pam.d/login
# oracle
session required /lib64/security/pam_limits.so
session required pam_limits.so


vi /etc/security/limits.conf
oracle soft nproc 131072
oracle hard nproc 131072
oracle soft nofile 131072
# 1024*128=131072
oracle soft nofile 131072
# 1024*1024=1048576
oracle hard nofile 1048576
oracle soft core unlimited
oracle hard core unlimited
# SGA size : 256G 1024*1024*256 = 268435456
oracle soft memlock 268435456
oracle hard memlock 268435456

vi /etc/sysctl.conf
kernel.sem = 250 32000 100 128
#net.ipv4.ip_local_port_range = 9000 65500
##net.ipv4.ip_local_port_range = 32768  60999
# 1024*1024*4=4194304
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
# 1024*1024=1048576
fs.aio-max-nr = 1048576
#fs.file-max = 681574
##fs.file-max = 39230827

#oracle SGA+PCA = 224*1024=229376 => 224G
#512*1024*1024=536870912 => 512M
#2*1024*1024=2097152 => 2G
kernel.shmmax = 536870912
kernel.shmall = 2097152
net.ipv4.ip_local_port_range = 9000 65500


#oracle SGA+PCA = 160*1024=163840 => 160G
#512*1024*1024=536870912 => 512M
#2*1024*1024=2097152 => 2G
kernel.shmmax = 536870912
kernel.shmall = 2097152
net.ipv4.ip_local_port_range = 9000 65500


# yum install xrdp
# yum grouplist
# yum groupinstall "KDE Plasma Workspaces"


systemctl start xrdp

# localectl status
# vi /etc/locale.conf

# vi /etc/fstab

/db1/swapfile none swap nofail,sw 0 0

tmpfs   /dev/shm        tmpfs   size=256g 0 0
# umount /dev/shm
# mount -a
# df -h



select * from sys.props$ where name='NLS_CHARACTERSET';
select * from sys.props$ where name='NLS_LANGUAGE';

# ipcs -lm
------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 18014398509465599
max total shared memory (kbytes) = 18014398442373116
min seg size (bytes) = 1

# cat /proc/sys/kernel/sem 
250	32.000	32	128

# cat /proc/sys/kernel/shmall
18446744073692774399

# cat /proc/sys/kernel/shmmax

# cat /proc/sys/net/ipv4/ip_local_port_range